package com.hx.vending.dao;

import com.hx.vending.bean.Trails;
import com.hx.vending.bean.TrailsGoods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2018/11/26.
 * 货道
 */
@Repository
public interface TrailsMapper {

    int deleteByPrimaryKey(Integer trailsId);

    int insertSelective(Trails record);

    Trails selectByPrimaryKeySelective(Trails record);

    List<Trails> selectByExampleSelective(Trails record);

    int updateByPrimaryKeySelective(Trails trails);

    //查询货道信息和该货到的商品信息
    List<TrailsGoods> selectTrailsAndGoods(Trails record);

    //根据层id删除货道
    int deleteByRiseId(Integer trailsRiseId);

    List<Trails> selectByExample(Trails trails);

    /**
     * 根据设备id删除货道
     * @param equipmentId
     * @return
     */
    int deleteByEquipmentId(String equipmentId);
    //解绑修改货道
    int updateByTrails(Trails trails);

    int insertBatchTrails(@Param("trailsList") List<Trails> trailsList);

    List<Trails> selectCaseGroupBy(@Param("equipmentId")String equipmentId);

    List<Trails> selectRiseGroupBy(@Param("caseNumber")Integer caseNumber,@Param("equipmentId")String equipmentId);

}

